treelistmodel: Fix memory leak
authorMohammed Sadiq <sadiq@sadiqpk.org>
Tue, 18 Sep 2018 01:58:56 +0000 (07:28 +0530)
committerMohammed Sadiq <sadiq@sadiqpk.org>
Tue, 18 Sep 2018 02:20:44 +0000 (07:50 +0530)
gtk_tree_list_model_init_node() increases the reference count
of the model passed. Let's not do that, and let it take the
model passed.

gtk/gtktreelistmodel.c

index a7f6619d827900a393bf73e0042d2c3ddd46b384..a612057d96234b39b12ea12a4bea8177bff9fb35 100644 (file)
@@ -494,7 +494,7 @@ gtk_tree_list_model_init_node (GtkTreeListModel *list,
   gsize i, n;
   TreeNode *node;
 
-  self->model = g_object_ref (model);
+  self->model = model;
   g_signal_connect (model,
                     "items-changed",
                     G_CALLBACK (gtk_tree_list_model_items_changed_cb),